package org.ytor.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.ytor.core.sqlflow.BaseLogic;
import org.ytor.core.sqlflow.BaseRepository;
import org.ytor.core.sqlflow.PersistenceModel;

/**
 * created by yangtong on 2025/4/6 下午8:51
 * <p>
 * 公共控制器类
 * <p>
 * 单表的增删改查接口由于代码高度相似，所以抽取成一个公共Controller
 *
 * @param <T> 实体类
 * @param <L> 实体类对应的service
 */
public class BaseController<T extends PersistenceModel<T, ?>, L extends BaseLogic<T, D>, D extends BaseRepository<T>> {

    protected L logic;

    protected D repository;

    @Autowired
    public void setLogic(L logic) {
        this.logic = logic;
    }

    @Autowired
    public void setRepository(D repository) {
        this.repository = repository;
    }

}
